<template>
    <el-dialog class="jzb-dialog" :title="title" :visible.sync="visibleDialog" :width="width" id="dept-dialog-choose" :close-on-click-modal="false" append-to-body v-dialogDrag>
        <el-main>
        1234
        </el-main>
        <el-footer height="auto" class="jzb-dialog-footer" slot="footer">
            <div class="content">已选部门：{{choosedList.length}}</div>
            <el-button name="btn-submit" size="medium" type="primary" icon="el-icon-receiving" @click="saveData()">保存</el-button>
            <el-button name="btn-cancel" size="medium" icon="el-icon-close" @click="visibleDialog=false">取 消</el-button>
        </el-footer>
    </el-dialog>
</template>
<script>
/** 组件功能：从本单位和参建单位选择some
* 传入：props
* 输出：somelist
*/
export default {
    props:{
        // 配置项
        comId:{ type: String, default: '' }, //单位ID
        title:{ type: String, default: '选择部门' }, //对话框title
        visible:{ type: Boolean, default: false }, //对话框显示
        ifInit:{ type: Boolean, default: false }, //是否初始化本单位信息
        width:{ type: String, default: '1000px' }, //对话框宽度
        value:{ type: Array, default:()=>{return []}}, //用户列表默认选中
    },
    data(){
        return {
            //1.基本
            visibleDialog:false,
            choosedList:[],
            dataList:[],
        };
    },    
    watch:{
        value(val){
            this.dataList = [...val];
        },
        visible(val){
            if(val) this.visibleDialog = true;
        },
        visibleDialog(val){
            if(!val) this.$emit('close');
        },
    },
    mounted(){

    },
    methods:{
        //保存数据
        saveData(){

        },
    },
};
</script>
<style lang="less" scoped>
@import "~@/assets/style/base.css";
@import "~@/assets/style/common.less";
</style>